package d0326;
import java.util.Set;
import java.util.TreeSet;

public class TestTreeSet {

    public static void main(String[] args) {
        Set<Student> treeSet = new TreeSet<>();
        Student stu1 = new Student("Jack",21,99);
        Student stu2 = new Student("Lucy",24,99);
        Student stu3 = new Student("Tom",26,99);
        Student stu4 = new Student("Bob",22,99);
        treeSet.add(stu1);
        treeSet.add(stu2);
        treeSet.add(stu3);
        treeSet.add(stu4);
        System.out.println("个数为："+treeSet.size());
        for(Student s : treeSet) {
            System.out.println(s);
        }
    }
}